package com.tangding;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer;
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;

import com.tangding.common.logx.LogHelp;

/**
 * @description 
 *
 * @author Ranger
 * @version 2017年7月5日_下午9:01:59
 *
 */
@SpringBootApplication(exclude = {MongoAutoConfiguration.class})
public class WebLauncher implements EmbeddedServletContainerCustomizer{
	
	@Value("${web_port:8080}")
	int port;
	
	public static void main(String[] args) {
		try {
			SpringApplication.run(WebLauncher.class, args);
			LogHelp.doLogApp("we-web start succ...");
		} catch (Exception e) {
			LogHelp.doLogException(e);
		}
	}

	@Override
	public void customize(ConfigurableEmbeddedServletContainer container) {
		container.setPort(port);
	}
}
